﻿<link href="~/Content/css/bootstrapframebutton.min.css" rel="stylesheet" />
<input type='button' value='Mua' class='btn btn-success' onclick='processbuy();' style='width: 100%; height: 100%;' />
<script src="~/Content/js/jquery.min.js"></script>
<script src="~/Content/js/bootstrapframebutton.min.js"></script>
<script>
    var tempId = "0";
    $(document).ready(function () {
        tempId = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
            var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
            return v.toString(16);
        });
    });
    function processbuy() {
        var newUrl = " http://byhand.vn/home/index?reflocation=" + document.referrer + "&id=@ViewData["productid"]&refid=1&tempId=" + tempId;
        //window.top.location.href = newUrl;
        var newWindow = window.open('', '_parent');
        newWindow.location = newUrl;
        newWindow.focus();
    }
</script>
